<?php
include 'islogin.php';
include '../config.php';

if(isset($_GET['flag']))
{
	if($_GET['flag']=="update")
	{
		$sql = "select id,name from download_type where id=".$_GET['id'];
		$result = mysql_query($sql);
		$row = mysql_fetch_array($result);
	}
}
if(isset($_POST['flag']))
{
	if($_POST['flag']=="update")
	{
		$sql = "update download_type set name='".$_POST['name']."' where id=".$_POST['id'];
		mysql_query($sql);
		header("location:downloadTypeList.php");
	}
}
?>

<script src="../js/jquery-1.7.1.js"></script>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<link href="css/right.css" rel="stylesheet" type="text/css"/>

<div style="border:0px solid red;"> 

    	<div id="top"><div>类型修改</div></div>
    	
	    <div id="middle">
	      <div class="layout">
		       <div class="title">类型修改</div>
		       <div class="content">
		        <form action="downloadTypeUpdate.php" method="post">
		         <input type="hidden" name="flag" value="update" />
		           <input type="hidden" name="id" value="<?php echo $row['id'];?>" />
		       		<table  cellspacing="0" cellpadding="0">  
		          	<tr>
		          		<td class="title_some_td" style="width:100px;">类型名称:</td>
		          		<td><input name="name" value="<?php echo $row['name'];?>"  /></td>
		          	</tr>
		          	<tr>
		          		<td></td>
		          		<td><input type="submit" value="保存" /></td>
		          	</tr>
		          </table>
		          </form>
		       </div>
		  </div>
		</div>
		<div id="bottom"></div>	
</div>		       